Release 10.1A: OpenEdge Development:
Progress 4GL Reference
TARGET-PROCEDURE system handle
From within an internal procedure: A handle to the procedure file mentioned, explicitly or implicitly, by the original RUN statement that invoked (perhaps through a chain of super procedures) the current internal procedure.
From within a user-defined function: A handle to the procedure file mentioned, explicitly or implicitly, by the original function invocation that invoked (perhaps through a chain of super versions of functions) the current user-defined function.
Syntax
attributeAn attribute of the TARGET-PROCEDURE handle.
methodA method of the TARGET-PROCEDURE handle.
Attributes
The TARGET-PROCEDURE handle supports all the attributes of the procedure handle. For a list of these attributes, see the reference entry for the THIS-PROCEDURE system handle in this chapter.
Methods
The TARGET-PROCEDURE handle supports all the methods of the procedure handle. For a list of these methods, see the reference entry for the THIS-PROCEDURE system handle in this chapter.
ExamplesThe following scenarios illustrate using TARGET-PROCEDURE without procedure overriding, with procedure overriding, and with super and non-super RUNs:
Scenario 1: Without procedure overriding
The following scenario uses TARGET-PROCEDURE without procedure overriding:
In this scenario:
Scenario 2: With procedure overriding
The following scenario uses TARGET-PROCEDURE with procedure overriding:
- A, B, and C, and X are handles of procedure files running persistently.
- B is a super procedure of A, and C is a super procedure of B.
Note: This is an example of procedure overriding.- proc1 is an internal procedure, different versions of which reside in A, B, and C.
- X says “RUN proc1 in A,” which runs A’s proc1.
- A’s proc1 says “RUN SUPER,” which runs B’s proc1.
- B’s proc1 says “RUN SUPER,” which runs C’s proc1.
In this scenario:
Scenario 3: With procedure overriding and additional complications
The following scenario uses TARGET-PROCEDURE with procedure overriding:
- A, B, and C, and X are handles of procedure files running persistently.
- B is a super procedure of A, and C is a super procedure of B.
Note: proc1 does not reside in A.- proc1 is an internal procedure, different versions of which reside in B and C.
- X says “RUN proc1 in A,” which runs B’s proc1 (since A has no proc1 and B is a super procedure of A).
- B’s proc1 says “RUN SUPER,” which runs C’s proc1.
In this scenario:
Scenario 4: With Super and Non-super RUNs
The following scenario shows how the value of TARGET-PROCEDURE changes when a non-super RUN occurs:
- A, B, and C are handles of procedure files running persistently.
- B is a super procedure of A, and C is a super procedure of B.
- proc1 is an internal procedure different versions of which reside in A, B, and C.
- proc2 is an internal procedure different versions of which reside in A, B, and C.
- A says “RUN proc1,” which runs A’s proc1.
Note: At this point, within any version of proc1 that runs as a result of its original RUN statement, the value of TARGET-PROCEDURE is A.- A’s proc1 says “RUN SUPER,” which runs B’s proc1.
Note: This is a non-super RUN.- B’s proc1 says “RUN proc2,” which runs B’s proc2.
In this scenario:
For a sample program that uses TARGET-PROCEDURE, see the reference entry for the RUN SUPER statement in this book.
Notes
- You can use TARGET-PROCEDURE in applications that do not use super procedures.
- The value of TARGET-PROCEDURE becomes THIS-PROCEDURE in the following places:
- For more information on super procedures, see OpenEdge Development: Progress 4GL Handbook .
See also
ADD-SUPER-PROCEDURE( ) method, REMOVE-SUPER-PROCEDURE( ) method, RUN SUPER statement, SOURCE-PROCEDURE system handle, SUPER function, SUPER-PROCEDURES attribute, TARGET-PROCEDURE system handle
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |